Universal Console Dashboard Project:  FCEUX edition
=====================================================

What is it?
-----------
Console emulators are suprisingly hard to use without a keyboard to access various functions.
This is counter-productive if your goal is to use a HTPC or something similar to play console games on a gamepad only.
The UCDP will utilize any means available to add a menu to emulators with gives you access to features via not only a gamepad,
but the console's original gamepad (with a usb adaptor of course).  In this case I'm using lua scripting built into FCEUX to 
add an in-game menu.

Requirements:
-------------
FCEUX, currently found at: http://www.fceux.com/web/download.html  (Any version on the site should work)
A gamepad OR a keyboard encoder with a button mapped to the "tilde" key.


Installation:
-------------
Copy the contents of this folder to the folder where FCEUX is installed.

Command-line Usage:
-------------------

fceux.exe -lua nesMenu.lua "C:\path\to\rom\rom.ext"

Note that the "lua" flags are BEFORE the rom path.  

How to Use:
-----------
Launch fceux via the syntax posted above.  When you want to bring up the menu, hold the Start button and the Select button.
Optionally pressing the tilde key on the keyboard will bring up the menu.  

While in the menu the B button selects and the A button goes back.  

In the menu you can load and save game states to one of any 10 slots, reset the game or Power off (aka exit the emulator).  

User Settings:
--------------
There are a select few settings within the NesMenu script in the menu folder.  They are well documented within the script,
so I won't go over them here, but keep in mind you are editing program code, not some config file, so keep the syntax in tact!

There are a few exceptions I would like to go over though.....  

PressEsc:  Normally the script exits via a os.exit call, which works fine, but is a hard close, 
           meaning if you changed any settings in fceux, they won't be saved.  If you would like to fix this, turn PressKey to "true",
		   Define the exit key of your choosing in the hotkeys menu of fceux, and then set the numerical value of that key (virtual key)
		   in the Exit Key Section. By default I've set the value to Escape, which is typical for most setups.
		   
EnablePresets:  FCEUX has this feature that allows you to setup 3 different control configurations in the input menu.  Enabling this feature will
                add a new menu item at the top of the menu where you can cycle through the presets via a press of the B button on your gamepad.  
                Again, just like PressEsc you'll need to define these hotkeys in fceux and then set the values you chose in the script as well.  
                By Default I've set these to f4, f5 and f6 as I doubt anyone will use those on their setup for something else. 

Note that for both of the options I've mentioned, the script calls the external keypresser.exe.  This might not be reliable on all systems, thus why
these options are disabled by default.  
	

LoLo Script:
------------
Remember that the NES was the first console with a pause button on the gamepad, so a few of the earlier games didn't know what to do with it.
In The Adventures of LoLo, the start button doesn't do anything and the select button kills you!  Because of this I have included a nesMenuLolo script.
With this script you simply hold down the non-functional start button for a few seconds to bring up the menu.  Use this script on any game that has select
button issues.


FAQS:
-----

Q: Can I use gamepad buttons/keyboard keys not mapped to FCEUX to bring up the menu?
A: In theory yes, in practice not so much.  Searching for "input.tilde" in the script and replacing it with a keyboard key of your choice will work fine.  
   As far as gamepads go nope, not unless you use joy2key or something similar to map a gamepad button to tilde.  

Q: The Menu is too slow/too fast!  What gives?
A: At the top of the script is a dbounce setting.  If the menu is too fast increase this value, if it's too slow, decrease it.  
   Vsync settings will effect this so get everything setup to your liking before altering this value!

Q: Man that Resolution on the menu is terrible.  Can't you make a hi-res menu?
A: Nope, the Menu is being rendered in-game, so we are limited to the NES's native resolution of 240x224.

Q: Where do I get/how do I make Game Genie codes?
A: You can find them on the net via googling.  You'll need to name the text file after the rom and format it according to the text file in the "GameGenie" folder.  
   If someone wants to go nuts and translate all the old GameGenie books (They used to send those out via mail!  Imagine that!) I'll include them.  

Skinners:
---------
There is a Skinner section of the lua script if you wish to make your own menu.
Each Menu element has a X position value, a Y position value, and a URL.

All images are in gdi format.  To make a gdi, make a bmp, gif, or jpeg (not reccomened) and run it through my img2gdi converter.
It'll take a while, so be patient.  Anything magenta in the image (255,0,255) will be made transparent.

The native resolution of the NES is 240x224, so you are limited to that.
Nes has an odd buffering system, so the left most/top most part of the screen is NOT 0,0  but rather 8,8.

FCEUX will auto-scale the menu regardless of resolution.



Bugs/Issues/Notes/Ect:
----------------------
Upon startup the script reads various things about the game.  Because of this the script will NOT operate properly if you load a new rom while fceux is still running!
Exit the emulator properly and relaunch instead.

The load/save state functions optionally save gdi snapshots to load in the menu (turned ON by default).  This works perfectly BUT gdi images are uncompressed.  Each one is 2.8kb, which 
doesn't sound like a lot but that means if you use all 10 save states you've made 2.8 megs of images!  Per Game!  In the future I may add an option to delete images via the menu, but 
for now just be mindful of it and remember that you can delete gdSnaps, which will NOT effect your game saves, by removing them from the "gdSnaps" folder.    